Repository navigation
soundwire: qcom: serialize WCD AHB bridge transactions and validate FIFO depth - #201
Open
robertijtsma wants to merge 1 commit into
Open
robertijtsma wants to merge 1 commit into
robertijtsma wants to merge 1 commit into
Conversation
…IFO depth On WCD934x-hosted Qualcomm SoundWire controllers (such as on the Surface Pro X / SC8180X), each AHB bridge register access consists of two separate regmap_bulk_*() transfers (RD_ADDR followed by RD_DATA, or WR_DATA followed by WR_ADDR). Without controller-level serialization across the pair, concurrent transfers from the threaded IRQ handler and probe/bus threads can interleave on the shared WCD AHB bridge registers, corrupting register reads/writes and leaving wr_fifo_depth as zero. Add a mutex (ahb_lock) in struct qcom_swrm_ctrl to serialize each complete two-step AHB bridge transaction, and read/validate SWRM_COMP_PARAMS write FIFO depth in qcom_swrm_probe() before enabling the SoundWire IRQ. Tested on Microsoft Surface Pro X SQ2 (SC8180X, WCD934x + WSA881x). Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On WCD934x-hosted Qualcomm SoundWire controllers (Surface Pro X / SC8180X), each AHB bridge register access performs two separate
regmap_bulk_*()transfers (SWRM_AHB_BRIDGE_RD_ADDR_0+RD_DATA_0orWR_DATA_0+WR_ADDR_0). Without controller-level serialization across the two-step pair, concurrent accesses from the threaded IRQ handler and probe/bus threads can interleave on the shared AHB bridge registers, corrupting reads/writes and occasionally readingwr_fifo_depth == 0.Changes
struct mutex ahb_locktostruct qcom_swrm_ctrland serialize each complete two-step AHB bridge transaction inqcom_swrm_ahb_reg_read()/qcom_swrm_ahb_reg_write().SWRM_COMP_PARAMSwrite FIFO capacity (supporting both pre-v3.1 and v3.1+ field masks) inqcom_swrm_probe()before requesting the SoundWire IRQ.Verification
scripts/checkpatch.plwith 0 errors, 0 warnings.s2idlesuspend/resume.